﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LearningDetail.aspx.cs" Inherits="ExaminationSys.LearningDetail"  MasterPageFile="~/View/Share/Index.Master" %>
<%@ Import Namespace="ExaminationSys.DataAccess.Entity" %>

<asp:Content ID="head" ContentPlaceHolderID="head" runat="server">
<link type="text/css" rel="stylesheet" media="all" href="css/style.css" />
<link type="text/css" rel="stylesheet" media="all" href="css/others.css" />
<style type="text/css">
    .current a:hover
    {
        color: #333333;
        text-decoration: none;
        cursor: default;
    }
</style>
 <script src="js/jquery.js" type="text/javascript"></script>

   <script type="text/javascript">
       $(function () {
           $("#btnSignOut").click(function () {
               var answer = confirm("是否退出?");
               if (answer) {

                   $.ajax({
                       type: "GET",
                       cache: false,
                       contentType: "application/json",
                       url: "ashx/StudentSignOutHandler.ashx",
                       dataType: 'json',
                       data: null,
                       async: false,
                       success: function (data) {
                           if (data != '200') {
                               alert('操作失败'); return false;
                           }
                           else {
                               var host = window.location.host;
                               window.location.href = "http://" + host + "/Index.aspx";
                           }
                       }
                   });
               }
           });
       });
</script>
</asp:Content>
<asp:Content ID="headerContent" ContentPlaceHolderID="HeaderHolder" runat="server">
    <div class="h-top">
        <div class="logo fl"><img src="images/logo.gif" alt="上海交通大学英语学习中心"/></div>
        <div class="navandsearch fr">
            <ul class="nav">
                  <li><a class="nav-home" href="Index.aspx" title="首页">首页</a></li>
                <li><a class="nav-info" href="Newslist.aspx" title="信息快递">信息快递</a></li>
                <li><a class="nav-help" href="Help.aspx" title="帮助">帮助</a></li>
            </ul>
            <div class="h-search">
                <input id="textKey" class="text" name="" type="text" value="搜索信息" />
                <input id="btnSearch" class="publicbtn btn-search" name="" type="button" value="搜索" />
            </div>
        </div><!--end navandsearch-->
    </div>
    <div class="h-banner"><img src="images/pic/pic02.jpg" width="966" height="308"/></div>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" runat="server">
<div class="side">
        	<div class="box203">
            	<div class="titles"><img src="images/tit_xx.gif" alt="用户信息"/></div>
            	<div class="conts side-login-on">
                	<p class="tit"><span class="red">欢迎您！</span><span><%=LoginName %></span>同学</p>
                	<ul>
                    	<li><a href="Profile.aspx">个人资料</a></li>
                        <li><a href="ChangePassword.aspx">密码修改</a></li>
                    </ul>
                    
                    <div class="button">
                    
                    <a href="StudyCenter.aspx" id="btnStudycenter"><span style="border:1px solid #e3e3e3;color:red;padding:3px;margin:18px">学习中心</span></a>
                    <input id="btnSignOut" class="publicbtn btn-logout" name="" type="button"  value="退出"/></div>	
                </div>
                <div class="box-bbg"></div>
            </div>
            


            <div class="side-mod-menu">
            	<h2><span class="subtit">当前阶段(<%=LevelName%>)</span></h2>

                <%--left menu nav begin--%>



                <%

                    
                    
                    //var item=SubSectionInfoCollection.Find(s => s.ID == CurrentSelectItem.SubSectionID);
                    //if(item!=null)
                    //{
                    //    SubSectionInfoCollection.Remove(item);
                    //    SubSectionInfoCollection.Insert(0, item);
                    //}
                    
                    foreach (var subSectionInfo in SubSectionInfoCollection)
                    {
                        htmlStr.AppendFormat("<h3><span>{0}</span></h3>", subSectionInfo.Name);
                        htmlStr.Append("<ul>");

                        var subDetailCollection = GetListBySubSectionId(subSectionInfo.ID);


                        if (subSectionInfo.ID == CurrentSelectItem.SubSectionID)
                        {
                            subDetailCollection.RemoveAll(s => s.ID == CurrentSelectItem.ID);
                            subDetailCollection.Insert(0, CurrentSelectItem);
                        }

                        
                        foreach (var detailInfo in subDetailCollection)
                        {
                            if (detailInfo.KnowledgeType == (int)EnumEnumSubSectionType.测试 || detailInfo.KnowledgeType == (int)EnumEnumSubSectionType.练习)
                            {
                                var href = string.Format("View/Student/JoinExamination.aspx?paperid={0}&stype={1}", detailInfo.PaperID, detailInfo.KnowledgeType);
                                htmlStr.AppendFormat("<li><a target=\"_blank\" href=\"{0}\">{1}</a></li>", href, detailInfo.Name);
                            }
                            else
                            {

                                if (detailInfo.ID == CurrentSelectItem.ID)
                                {
                                    htmlStr.AppendFormat(
                                        "<li class=\"current\"><a href=\"javascript:void(0);\" >{0}</a></li>",
                                        detailInfo.Name);
                                }
                                else
                                {
                                    var href = string.Format("/LearningDetail.aspx?level={0}&id={1}", KnowlegdeLevel,
                                                             detailInfo.ID);
                                    htmlStr.AppendFormat("<li><a href=\"{0}\">{1}</a></li>", href, detailInfo.Name);
                                }
                            }
                        }
                        htmlStr.Append("</ul>");

                    }%>
                    
                <%-- end left menu --%>
                
                <%= htmlStr.ToString() %>

            	<%--<h3><span>知识点学习</span></h3>
                <ul>
                	<li><a href="#">单元1</a></li>
                	<li><a href="#">单元2</a></li>
                	<li><a href="#">单元3</a></li>
                </ul>
                
                <h3><span>练习</span></h3>
                <ul>
                	<li><a href="#">练习1</a></li>
                	<li><a href="#">练习2</a></li>
                	<li><a href="#">练习3</a></li>
                </ul>
                
                <h3><span>测试</span></h3>
                <ul>
                	<li><a href="#">测试1</a></li>
                	<li><a href="#">测试2</a></li>
                	<li><a href="#">测试3</a></li>
                </ul>--%>
            </div>
           
        </div><!--end side-->
    <!--end side-->


    <div class="contents">
        <div class="study-detail study-cent-fist"> 
            	<div class="study-detail-top">
            		<h2><span class="subtit"><%= CurrentSelectItem.Name %></span></h2>	
                    <div class="btm">
                    	<span class="name">整理人：<%= TeacherName %></span>
                        <span class="time">时间：<%=CurrentSelectItem .OpeatorTime.ToString("yyyy-MM-dd")%> </span>
                    </div>
                </div>                
                <div class="study-detail-cont">
                	<p>
                        <%= CurrentSelectItem.Content%>
                    </p>
                    
                </div><!--end study-detail-cont-->
            </div>
    </div>
    <!--end contents-->
</asp:Content>

